// // import { count } from "./ts/count";
// // import { sum } from "./ts/sum";
import _ from 'lodash';
import numRef from './ref.json';
// import top from './assets/images/上游.png'
// console.log(top, 'top')

// // console.log(count(2, 3), "count");
// // console.log(sum(1, 2, 3, 4, 5, 6), "sum");
// // Service Worker 服务停止能访问页面
// // if ('serviceWorker' in navigator) {
// //   window.addEventListener('load', () => {
// //     navigator.serviceWorker.register('/service-worker.js').then(registration => {
// //       console.log('SW registered: ', registration);
// //     }).catch(registrationError => {
// //       console.log('SW registration failed: ', registrationError);
// //     });
// //   });
// // }

// console.log(numRef, 'numRefnumRefts')

export function numToWord(num: number) {
  return _.reduce(
    numRef,
    (accum: any, ref: any) => {
      return ref.num === num ? ref.word : accum;
    },
    ''
  );
}

export function wordToNum(word: string) {
  return _.reduce(
    numRef,
    (accum: any, ref: any) => {
      return ref.word === word && word.toLowerCase() ? ref.num : accum;
    },
    -1
  );
}


import { createApp } from 'vue';
import App from './App';
import router from './router';
const app = createApp(App);
app.use(router).mount('#app')